;
; SCSI.SH Version 1.01 (C)1995,1996 HUDSON SOFT
; SCSI(CR-ROM)関連 アセンブラ用ヘッダーファイル(SCSI.SH)
;
	ifndef	_SCSI_SH_
_SCSI_SH_	equ	1
;
	ifndef	NULL
NULL		equ	0
	endif

	include	"scsi_cmd.sh"

;---  scsi()  -----------------------------------------------------;
;------------------------------------------------------------------;

;---  struct of SCSI command  ---------------------;

scsi_cmd	struct
istat:		ds	4	;initiator status
tstat:		ds	4	;target status
unit:		ds	4	;target unit no
mess:		ds	4	;message
data:		ds	4	;address of data buffer, pointer for u_char
count:		ds	4	;data count
block:		ds	4	;block size
mode:		ds	4	;read mode
cmd:		ds	4	;command data block, pointer for u_char
		ends
;typedef struct scsi_cmd SCSI;

read28_prm	struct
stat:		ds	4	;function status
id_bit:		ds	4	;target unit id bit
block:		ds	4	;top block
blklen:		ds	4	;block length
scsi_stat:	ds	4	;scsi status phase value
		ends
;typedef struct read28_prm READ28;

;---  initiator status  ---------------------------;

INIT_OK		equ	$0080	;good
INIT_TO		equ	$0040	;time out
INIT_DL		equ	$0020	;bad data length
INIT_BUSY	equ	$0010	;scsi controller busy

;---  target status  ------------------------------;

TRGT_BUSY	equ	$0008	;busy
TRGT_CM		equ	$0004	;condition met
TRGT_CC		equ	$0002	;check condition
TRGT_GOOD	equ	$0000	;good

;---  read mode  ----------------------------------;

READ_MRAM	equ	0
READ_KRAM	equ	1
READ_KRAM_DMA	equ	3

;---  read28 stat  --------------------------------;

READ28_END		equ	0
READ28_IDLE		equ	1
READ28_READ		equ	2
READ28_BUSY		equ	3
READ28_NOT_CONNECT	equ	4
READ28_BREAK		equ	5
READ28_ABORT		equ	6

;---  scsi_dma_int return value  ------------------;

DMA_SCSI	equ	0
DMA_READ28	equ	1
DMA_OTHER	equ	-1

;---  scsi_block_int return value  ------------------;

PPM_DMA_SCSI	equ	0
PPM_DMA_READ28	equ	1
PPM_DMA_OTHER	equ	-1

;---  scsi commands  ------------------------------;

	globl	scsi,init_scsi,bzero,reset_scsi
	globl	open_read28,close_read28,read28
	globl	scsi_dma_int,scsi_block_int

;------------------------------------------------------------------;
	endif	; !_SCSI_SH_
